//
//  SXTopicListModel.m
//  ShiXun
//
//  Created by lanou on 15/10/28.
//  Copyright © 2015年 张琪. All rights reserved.
//

#import "SXTopicListModel.h"

@implementation SXTopicListModel

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.userModel = [[SXTopicListUserModel alloc] init];
    }
    return self;
}

- (void)setValue:(id)value forKey:(NSString *)key
{
    if ([key isEqualToString:@"user"]) {
        [self.userModel setValuesForKeysWithDictionary:value];
    }else if ([key isEqualToString:@"thumb_image_list"])
    {
        self.thumbImageArray = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dict in value) {
            _thumbImageModel = [[SXTopicListThumbImageModel alloc] init];
            [_thumbImageModel setValuesForKeysWithDictionary:dict];
            [_thumbImageArray addObject:_thumbImageModel];
        }
    }else if ([key isEqualToString:@"thread_id"]) {
        self.thread_id = [NSString stringWithFormat:@"%@",value];
    }else {
        [super setValue:value forKey:key];
    }
}


@end
